package de.schlinke_marius.utils;

import de.schlinke_marius.application.MSComputerApplication;
import de.schlinke_marius.data.AppContainer;
import android.app.Activity;

public class AppUtils {

	public static AppContainer geGlobalDataOrExitActivity(final Activity activity) {
		MSComputerApplication application = (MSComputerApplication) activity.getApplication();
		AppContainer globalData = application.getGlobalData();
		if (globalData == null || globalData.getExamples() != null) {
			return globalData;
		} else {
			activity.finish();
			return null;
		}
	}
}
